package com.ruoyi.lwpq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lwpq.mapper.LwpqKhglMapper;
import com.ruoyi.lwpq.domain.LwpqKhgl;
import com.ruoyi.lwpq.service.ILwpqKhglService;
import com.ruoyi.common.core.text.Convert;

/**
 * khglService业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-17
 */
@Service
public class LwpqKhglServiceImpl implements ILwpqKhglService 
{
    @Autowired
    private LwpqKhglMapper lwpqKhglMapper;

    /**
     * 查询khgl
     * 
     * @param id khgl主键
     * @return khgl
     */
    @Override
    public LwpqKhgl selectLwpqKhglById(Long id)
    {
        return lwpqKhglMapper.selectLwpqKhglById(id);
    }

    /**
     * 查询khgl列表
     * 
     * @param lwpqKhgl khgl
     * @return khgl
     */
    @Override
    public List<LwpqKhgl> selectLwpqKhglList(LwpqKhgl lwpqKhgl)
    {
        return lwpqKhglMapper.selectLwpqKhglList(lwpqKhgl);
    }

    /**
     * 新增khgl
     * 
     * @param lwpqKhgl khgl
     * @return 结果
     */
    @Override
    public int insertLwpqKhgl(LwpqKhgl lwpqKhgl)
    {
        lwpqKhgl.setCreateTime(DateUtils.getNowDate());
        return lwpqKhglMapper.insertLwpqKhgl(lwpqKhgl);
    }

    /**
     * 修改khgl
     * 
     * @param lwpqKhgl khgl
     * @return 结果
     */
    @Override
    public int updateLwpqKhgl(LwpqKhgl lwpqKhgl)
    {
        lwpqKhgl.setUpdateTime(DateUtils.getNowDate());
        return lwpqKhglMapper.updateLwpqKhgl(lwpqKhgl);
    }

    /**
     * 批量删除khgl
     * 
     * @param ids 需要删除的khgl主键
     * @return 结果
     */
    @Override
    public int deleteLwpqKhglByIds(String ids)
    {
        return lwpqKhglMapper.deleteLwpqKhglByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除khgl信息
     * 
     * @param id khgl主键
     * @return 结果
     */
    @Override
    public int deleteLwpqKhglById(Long id)
    {
        return lwpqKhglMapper.deleteLwpqKhglById(id);
    }
}
